﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Test
{

        //可以在任何项目中访问类
        public class Class1
        {
            //定义私有的静态的整型字段class_id
            private static int class_id;

            //定义私有的只读的字段id
            private readonly int id;

            //定义公开的只读的字符串类型字段class_name
            public readonly string class_name;

        //定义公开的静态的字符串类型字段name
            private readonly string name;

            //定义内部的静态的整型字段class_age
            internal static int class_age;

            //定义内部的只读的整型字段age
            internal readonly int age;

            //定义只能由类或派生类中的代码访问的只读的整型字段class_number
            protected readonly int class_number;

            //定义只能由类或派生类中的代码访问的静态的整型字段number
            protected static int number;
        }




    //抽象的可以在任何项目中访问类
    public abstract class Class2
    {
        //定义私有的静态的整型字段class_id
        private static int class_id;

        //定义私有的只读的字段id
        private readonly int id;

        //定义公开的只读的字符串类型字段class_name
        public readonly string class_name;

        //定义公开的静态的字符串类型字段name
        private readonly string name;

        //定义内部的静态的整型字段class_age
        internal static int class_age;

        //定义内部的只读的整型字段age
        internal readonly int age;

        //定义只能由类或派生类中的代码访问的只读的整型字段class_number
        protected readonly int class_number;

        //定义只能由类或派生类中的代码访问的静态的整型字段number
        protected static int number;
    }




    //密封的可以在任何项目中访问类
    public sealed class Class3
    {
        //密封的定义私有的静态的整型字段class_id
        private static int class_id;

        //密封的定义私有的只读的字段id
        private readonly int id;

        //密封的定义公开的只读的字符串类型字段class_name
        public readonly string class_name;

        //密封的定义公开的静态的字符串类型字段name
        private readonly string name;

        //密封的定义内部的静态的整型字段class_age
        internal static int class_age;

        //密封的定义内部的只读的整型字段age
        internal readonly int age;

        //密封的定义只能由类或派生类中的代码访问的只读的整型字段class_number
        protected readonly int class_number;

        //密封的定义只能由类或派生类中的代码访问的静态的整型字段number
        protected static int number;
    }



    //可以在任何项目中访问类
    public static class Class4
    {
        //定义私有的静态的整型字段class_id
        private static int class_id;

        //定义内部的静态的整型字段class_age
        internal static int class_age;

    }
}

